/****************************************Copyright (c)**************************************************
**                                         2016-03
**
**                                
**
**
**--------------File Info-------------------------------------------------------------------------------
** File name:		    ht6x1x_lcd.h
** Last modified Date:  2016-03-29
** Last Version:		v1.0
** Descriptions:		
**
**------------------------------------------------------------------------------------------------------
** Created by:			Evan Chen
** Created date:		2016-03-29
** Version:				v1.0
** Descriptions:		
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __HT6X1X_LCD_H
#define __HT6X1X_LCD_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "ht60xx.h"

/*LCDCLK*/
#define LCDCLK_BIASCTL_MASK      	((uint16_t)0x0080)
#define LCDCLK_BIASCTL_1F4    		((uint16_t)0x0000)
#define LCDCLK_BIASCTL_1F3       		((uint16_t)0x0080)

#define LCDCLK_DUTY_MASK      		((uint16_t)0x0018)
#define LCDCLK_DUTY_4COM      		((uint16_t)0x0000)
#define LCDCLK_DUTY_6COM      		((uint16_t)0x0008)
#define LCDCLK_DUTY_8COM     		((uint16_t)0x0010)

#define LCDCLK_LCLK_MASK      		((uint16_t)0x0007)

#define LCDCLK_4COM_128HZ			((uint16_t)0x0004)
#define LCDCLK_4COM_64HZ			((uint16_t)0x0000)
#define LCDCLK_4COM_32HZ			((uint16_t)0x0001)
#define LCDCLK_4COM_16HZ			((uint16_t)0x0002)
#define LCDCLK_4COM_8HZ			((uint16_t)0x0003)

#define LCDCLK_6COM_85HZ			((uint16_t)0x0004)
#define LCDCLK_6COM_42HZ			((uint16_t)0x0000)
#define LCDCLK_6COM_21HZ			((uint16_t)0x0001)
#define LCDCLK_6COM_10HZ			((uint16_t)0x0002)
#define LCDCLK_6COM_5HZ			((uint16_t)0x0003)

#define LCDCLK_8COM_64HZ			((uint16_t)0x0004)
#define LCDCLK_8COM_32HZ			((uint16_t)0x0000)
#define LCDCLK_8COM_16HZ			((uint16_t)0x0001)
#define LCDCLK_8COM_8HZ			((uint16_t)0x0002)
#define LCDCLK_8COM_4HZ			((uint16_t)0x0003)

/*LCDCON*/
#define LCDCON_FCSET_MASK      		((uint16_t)0x00C0)
#define LCDCON_FCSET_1F8    			((uint16_t)0x0000)
#define LCDCON_FCSET_1F16       		((uint16_t)0x0040)
#define LCDCON_FCSET_1F32    		((uint16_t)0x0080)
#define LCDCON_FCSET_1F64       		((uint16_t)0x00C0)

#define LCDCLK_FC_MASK      			((uint16_t)0x0020)
#define LCDCLK_FC_37K    			((uint16_t)0x0000)
#define LCDCLK_FC_146K       			((uint16_t)0x0020)

#define LCDCLK_LC_MASK      			((uint16_t)0x0010)
#define LCDCLK_LC_37K    			((uint16_t)0x0000)
#define LCDCLK_LC_146K       			((uint16_t)0x0010)

#define LCDCON_VRSET_MASK      		((uint16_t)0x000F)

void LCD_Init(uint16_t bias, uint16_t duty, uint16_t clk);
void LCD_Contrast(uint16_t sel);

#ifdef __cplusplus
}
#endif

#endif /* __HT6X1X_LCD_H */

